package com.winner.es.exception;

/**
 * 业务异常错误码 和 全局异常错误码
 */
public enum EsResultEnum  {

    SYSTEM_EXCEPTION(-1, "system error, please check."),

    REQUEST_FIELD_ERROR(-2, "request parameters error"),

    REQUEST_METHOD_NOT_SUPPORT(-3, "Request method not supported."),

    INVALIDATE_JSON_FORMAT(-4, "Invalidate Json format, please check."),

    SUCCESS(0,"成功");

    // 枚举的构造
    EsResultEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    private Integer code;
    private String message;

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
